home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ian & Stuart's Australian Mac: Not for Sale
/
Another.not.for.sale (Australia).iso
/
fade into you
/
getting there
/
WWW
/
MacHTTP Extras
/
map demo
/
cat_map_tr.script
< prev
next >
Wrap
Text File
|
1994-05-11
|
2KB
|
44 lines
-- Uncomment the following "on" line if you want to compile this script as an application.
-- The script should be renamed to cat_map.exe and the HTML docs should be changed accordingly
--on «event WWWΩsrch» http_search_args
-- Change the following line to be the domain name or IP address of your MacHTTP server
set this_server_addr to "oac2.hsc.uth.tmc.edu"
set crlf to (ASCII character 13) & (ASCII character 10)
--this is a normal HTTP header returned when this script generates HTML for return
-- to the server.
set http_10_header to "HTTP/1.0 200 OK" & crlf & "Server: MacHTTP" & crlf & ¬
"MIME-Version: 1.0" & crlf & "Content-type: text/html" & crlf & crlf
--header used for URL redirects
set redirect_head to "HTTP/1.0 302 Found" & crlf & "Location: http://" & this_server_addr & "/map%20demo/"
--doc to return to on the off chance that something screws up.
set parent_doc to "HTTP/1.0 302 Found" & crlf & "Location: http://" & this_server_addr & "/map%20demo/cat_map_tr.html"
if http_search_args = "" then
return parent_doc
else
set comma to offset of "," in http_search_args
set theLast to count http_search_args
set x to (text 1 thru (comma - 1) of http_search_args) + 0
set y to (text (comma + 1) thru theLast of http_search_args) + 0
end if
--return http_10_header & x & "," & y
if x > 8 and x < 50 and y > 60 and y < 100 then
--Got the eyes!
return http_10_header & "<title>The EYES Have it!</title><img src=dead_cat_face.gif>Got the eyes!"
else
--Missed...
return http_10_header & "<title>Missed!</title><h1>You missed the eyes!</h1>"
end if
--uncomment the following line if the script is saved as an application
--end «event WWWΩsrch»